<template>
  <div ref="radar" class="max" />
</template>

<script>
import * as echarts from 'echarts'
export default {
  mounted() {
    // 基于准备好的dom，初始化echarts实例
    const myChart = echarts.init(this.$refs.radar)
    // 绘制图表
    const option = {
      textStyle: {
        fontSize: 16
      },

      radar: {
        // shape: 'circle',
        indicator: [
          { name: '销售额', max: 6500 },
          { name: '管理费用', max: 16000 },
          { name: '技术支出', max: 30000 },
          { name: '客户服务', max: 38000 },
          { name: '产品研发', max: 52000 },
          { name: '市场营销', max: 25000 }
        ]
      },
      series: [
        {
          name: 'Budget vs spending',
          type: 'radar',
          data: [
            {
              value: [4200, 3000, 20000, 35000, 50000, 18000],
              name: 'Allocated Budget'
            },
            {
              value: [5000, 14000, 28000, 26000, 42000, 21000],
              name: 'Actual Spending'
            }
          ]
        }
      ]
    }
    myChart.setOption(option)
  }
}
</script>

<style scoped>
.max{
    height: 400px;
}
</style>

